This disclosure relates generally to database management systems, and more specifically, to reusing deleted database records.
Database manager modules may perform the two functions of accessing and modifying data from a database table within a file. Database manager modules may access data by selecting and delivering particular database records requested by a user based on a query statement. The query statement specifies the particular attributes, table, and query conditions that a user desires. Database manager modules may modify data by inserting (writing) new database records (rows) in a table, updating (writing) values within the database records, or deleting particular database records from a table matching specified query conditions.
When a new database record is inserted into a database table, database manager modules may employ an operation called “Reuse Deleted” (RD) records (e.g., REUSEDLT (*YES)). The RD records operation allows a database manager module to insert a new database record by using a previously deleted database record. When a database record is deleted through a delete operation, the database manager module may flag the database record as deleted. This means that the database record may still exist in the database even though the flagged database records cannot be accessed through a query. Accordingly, when the insert and RD records operations occur, the delete flags may be released on the previously deleted record such that the insert operation may access and reuse the previously deleted record.